<script>
function setFocus(){
	$('identity').focus()
}

window.addEvent('domready', function(){
		
		$('description').mooEditable({
		actions: 'bold italic underline strikethrough | formatBlock justifyleft justifyright justifycenter justifyfull | insertunorderedlist insertorderedlist indent outdent insertHorizontalRule | undo redo removeformat | createlink unlink | urlimage | toggleview'
		});
		
	//setFocus();
        new FormCheck('event_edit', {
		display : {
			errorsLocation : 1,
			showErrors : 1,
			addClassErrorToField : 1
		}
	})
});

</script>
<style type="text/css">
			#description{
				width: 700px;
				height: 200px;
				padding: 10px;
				border: 2px solid #ddd;
			}
			</style>
<?php $id = $this->uri->segment(3,0)?>
<form action="<?php echo site_url(array('just4u','event_update',$id))?>" method="post" enctype="multipart/form-data" name="event_edit" id="event_edit">
<?php 
foreach ($query->result() as $row):
	if($row->images_type=="" || $row->images_type==NULL){
		$images = site_url("images/noimages.jpg");
	} else {
		$images = site_url(array('just4u','ImagesMedium','event',$row->id_event));
	}
?>
<table width="0%" border="0" cellspacing="2" cellpadding="3">
  <tr>
    <th align="right">Name</th>
    <td><input value="<?php echo $row->name ?>" name="name" type="text" id="name" size="35" maxlength="100" class="validate['required']" />
      <input type="hidden" name="id" id="id" value="<?php echo $this->uri->segment(3,0)?>" /></td>
  </tr>
  <tr>
    <th align="right" valign="top">Images</th>
    <td><img src="<?php echo $images?>" /><br />
      <input type="file" name="images" id="images" /></td>
  </tr>
  <tr>
    <th align="right" valign="top">Description</th>
    <td><textarea name="description" id="description" cols="45" rows="6"><?php echo $row->description?></textarea></td>
  </tr>
  <tr>
    <th align="right" valign="top">&nbsp;</th>
    <td align="right"><input type="reset" name="button2" id="button2" value="Reset" class="uiButtonRounded" />
      <input type="submit" name="button" id="button" value="Save" class="uiButtonRounded" /></td>
  </tr>
</table>
<?php endforeach;?>
</form>